package com.example.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.SalesOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SalesOrderDao extends BaseMapper<SalesOrder> {

    @Select("SELECT name,SUM(number) AS number from sales_order GROUP BY name")
    public List<SalesOrder> getGoodsNumber();

    @Select("SELECT salesman_name,SUM(total) AS total from sales_order GROUP BY salesman_name")
    public List<SalesOrder> getTotalForSalesman();
}
